#include "DummyTracker.h"
#include "Player.h"
#include <SDL.h>


DummyTracker::DummyTracker(const Loader* pParams)
	: Enemy(pParams) {} 


void DummyTracker::Render() const 
{
	SDLGameObject::Render();   
}


void DummyTracker::Update() 
{
	m_currentFrame = static_cast <int> ((SDL_GetTicks() / 100) % 6);
}


void DummyTracker::Track(const Player& player)
{
	Vector2D target = player.Position(); 

	// Basic chase algorithm
	if (m_position.x > target.x)
		--m_position.x;

	else if (m_position.x < target.x)
		++m_position.x; 

	if (m_position.y > target.y)
		--m_position.y; 

	else if (m_position.y < target.y)
		++m_position.y;
}


void DummyTracker::CleanUp()
{
}
